package estyle.auto.nkornilova.pages;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;

public abstract class AnyPage extends Page {

    public AnyPage(PageManager pages) {
        super(pages);
    }

    protected void pressEnterIntoWebElement(WebElement webElement)
    {
        new Actions(driver)
                .sendKeys(webElement, Keys.RETURN)
                .perform();
    }

    protected void moveToFrameByLocator(By locator)
    {
        driver.switchTo().frame(driver.findElement(locator));
    }

}
